package com.kaili.zuul.filter;

import com.netflix.zuul.ZuulFilter;
import com.netflix.zuul.context.RequestContext;

/**
 * package name:com.kaili.zuul.filter
 * author:hasee
 * date :2018/7/2
 * project:micro-service
 */
public class RequstUriFilter extends ZuulFilter {
    @Override
    public String filterType() {
        return "pre";
    }

    @Override
    public int filterOrder() {
        return Integer.MAX_VALUE;
    }

    @Override
    public boolean shouldFilter() {
        return true;
    }

    @Override
    public Object run() {
        RequestContext context = RequestContext.getCurrentContext();
        context.put("requestURI", context.getRequest().getRequestURI());
        return null;
    }
}
